package com.ma.table.actors.botones;

import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.ma.logica.Assets;
import com.ma.logica.Constantes;

public class BotonVida extends Actor {
	
	public TextureRegion[][] tmp;
	public TextureRegion texturaFinalBoton;
    public Texture botonTexture;
	
	public BotonVida(BotonDoblar botonDoblar) {
		setHeight(Constantes.TAMANIO_BOTON_H);
		setWidth(Constantes.TAMANIO_BOTON_W);
		setPosition(Constantes.POSICON_X_BOTON_COMPRAR_VIDA,Constantes.POSICON_Y_BOTON_COMPRAR_VIDA);
		
		botonTexture = Assets.instance.images.botonesTexture;
        tmp = TextureRegion.split(botonTexture, botonTexture.getWidth()/3, botonTexture.getHeight() );
        
        texturaFinalBoton = tmp[0][0];
	}
	
	 @Override
	 public void draw(Batch batch,float parentAlpha){
		 batch.draw(texturaFinalBoton, getX(), getY(), getOriginX(), getOriginY(), getWidth(), getHeight(), getScaleX(), getScaleY(), getRotation());
		 batch.flush();
	 }
}
